/* GUI CONVERTED from rerp11.p (converter v1.75) Sat Aug 12 23:08:35 2000 */
/* rerp11.p - Repetitive                                                     */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                       */
/* All rights reserved worldwide.  This is an unpublished work.              */
/*F0PN*/ /*V8:ConvertMode=Report                                             */
/*J314*/ /*V8:RunMode=Character,Windows                                      */
/* REVISION: 7.3      LAST MODIFIED: 10/31/94   BY: WUG *GN77*               */
/* REVISION: 7.3      LAST MODIFIED: 03/01/95   BY: WUG *G0G7*               */
/* REVISION: 7.3      LAST MODIFIED: 10/20/95   BY: STR *G19J*               */
/* REVISION: 8.6      LAST MODIFIED: 04/09/97   BY: *K08N* Steve Goeke       */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane         */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan        */
/* REVISION: 9.1      LAST MODIFIED: 10/25/99   BY: *N002* Bill Gates        */
/* REVISION: 9.1      LAST MODIFIED: 11/17/99   BY: *N04H* Vivek Gogte       */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00 BY: *N0KP* myb                 */

          /* SUBCONTRACT SHIPPER PRINT */


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

          {mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

/*N002**
 * &SCOPED-DEFINE rerp11_p_1 "Vehicle ID"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rerp11_p_2 "Qty Shipped"
 * /* MaxLen: Comment: */
 *N002**/

&SCOPED-DEFINE rerp11_p_3 "Type"
/* MaxLen: Comment: */

/*N002**
 * &SCOPED-DEFINE rerp11_p_4 "Qty"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rerp11_p_5 "Vehicle ID:"
 * /* MaxLen: Comment: */
 *N002**/

&SCOPED-DEFINE rerp11_p_6 "Shipper/Container"
/* MaxLen: Comment: */

/*N002** &SCOPED-DEFINE rerp11_p_7 "Tare!Weight"  */
/*N002** /* MaxLen: Comment: */                   */

&SCOPED-DEFINE rerp11_p_8 "Ship-From Site"
/* MaxLen: Comment: */

/*N002** &SCOPED-DEFINE rerp11_p_9 "Tare Weight"  */
/*N002** /* MaxLen: Comment: */                   */

&SCOPED-DEFINE rerp11_p_10 "Shipper/Container ID"
/* MaxLen: Comment: */

&SCOPED-DEFINE rerp11_p_11 "Ship-From Location"
/* MaxLen: Comment: */

/*N002**
 * &SCOPED-DEFINE rerp11_p_12 "Shipment Weight Summary"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rerp11_p_13 "Ship To:"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rerp11_p_14 "Ship Via:"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rerp11_p_15 "Ship Date:"
 * /* MaxLen: Comment: */
 *N002**/

&SCOPED-DEFINE rerp11_p_16 "Ship-To/Dock"
/* MaxLen: Comment: */

/*N002**
 * &SCOPED-DEFINE rerp11_p_17 "WO ID!PO Number"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rerp11_p_18 "FOB Point:"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rerp11_p_19 "Mode of Transport:"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rerp11_p_20 "Page:"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rerp11_p_21 "Carrier Shipment Ref:"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rerp11_p_22 "Gross!Weight"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rerp11_p_23 "P A C K I N G   L I S T"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rerp11_p_24 "Carrier Shipment Ref"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rerp11_p_25 "Mode of Transport"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rerp11_p_26 "Print Date:"
 * /* MaxLen: Comment: */
 *N002**/

&SCOPED-DEFINE rerp11_p_27 "Item Number"
/* MaxLen: Comment: */

/*N002**
 * &SCOPED-DEFINE rerp11_p_28 "Operation"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rerp11_p_29 "Item Number!Description"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rerp11_p_30 "Op Description"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rerp11_p_31 "Op!Line"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rerp11_p_32 "Net!Weight"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rerp11_p_33 "          S H I P P E R"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rerp11_p_34 "      Shipper ID:"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rerp11_p_35 "    Container ID:"
 * /* MaxLen: Comment: */
 *N002**/

/* ********** End Translatable Strings Definitions ********* */


          define variable type like mfc_logical label {&rerp11_p_3}
             format {&rerp11_p_6} init yes.
          define variable ctype as character label "T" format "x(1)".
          define variable disp_abs_id as character.
/*N002**
 *        define new shared variable addr as character format "x(38)" extent 6.
 *        define variable shipto as character format "x(38)" extent 6.
 *        define variable company as character format "x(38)" extent 6.
 *        define variable print_date as date.
 *        define variable pages as integer.
 *        define variable cust like so_cust.
 *        define variable ship like so_ship.
 *        define variable addr_id as character.
 *        define variable abs_shipvia like so_shipvia.
 *        define variable abs_fob like so_fob.
 *        define variable abs_trans_mode as character format "x(20)"
 *           label {&rerp11_p_25}.
 *        define variable abs_carr_ref as character format "x(20)"
 *           label {&rerp11_p_24}.
 *        define variable abs_veh_ref as character format "x(20)"
 *           label {&rerp11_p_1}.
 *        define variable rpt_type as character format "x(23)".
 *        define variable type_nbr as character format "x(17)".
 *        define variable par_shipfrom as character.
 *        define variable par_id as character.
 *        define variable disp_item as character format "x(24)"
 *           label {&rerp11_p_27}.
 *        define variable cum_qty like sod_cum_qty[1] extent 0.
 *        define variable abs_twt like abs_gwt label {&rerp11_p_9}.
 *N002*/
          define variable abs_recid as recid.
          define shared variable global_recid as recid.
/*N002**
 *        define variable shipto_id as character.
 *        define variable i as integer.
 *N002**/
          define variable shipper_id as character.
          define variable ship_date as date.
          define variable abs-confirm  as character format "x(1)".
/*N002**
 *        define variable op like wr_op column-label {&rerp11_p_28}.
 *        define variable part like pt_part.
 *        define variable shipfrom like abs_shipfrom.
 *N002**/

/*N04H**  {rewrsdef.i}                                                        */

/*N002*/  define new shared variable h_wiplottrace_procs as handle no-undo.
/*N002*/  define new shared variable h_wiplottrace_funcs as handle no-undo.
/*N002*/  {wlfnc.i} /*FUNCTION FORWARD DECLARATIONS*/
/*N002*/  if is_wiplottrace_enabled() then do:
/*N002*/    {gprunmo.i &program=""wlpl.p"" &module="AWT"
            &persistent="""persistent set h_wiplottrace_procs"""}
/*N002*/    {gprunmo.i &program=""wlfl.p"" &module="AWT"
            &persistent="""persistent set h_wiplottrace_funcs"""}
/*N002*/  end.

          
/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
             
 RECT-FRAME       AT ROW 1 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL VIEW-AS TEXT SIZE-PIXELS 1 BY 1
 SKIP(.1)  /*GUI*/
type                 colon 28
             abs_shipfrom         colon 28 label {&rerp11_p_8}
             si_desc              at 45 no-label
             abs_id               colon 28 label {&rerp11_p_10}
          with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER INITIAL "".
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:HIDDEN in frame a = yes.
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5.  /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



          /* SET EXTERNAL LABELS */
          setFrameLabels(frame a:handle).

          FORM /*GUI*/ 
             abs_loc              colon 20 label {&rerp11_p_11}
             ad_name              at 45 no-label
             abs_shipto           colon 20 label {&rerp11_p_16}
             ad_line1             at 45 no-label
          with STREAM-IO /*GUI*/  frame b side-labels width 80 attr-space.

          /* SET EXTERNAL LABELS */
          setFrameLabels(frame b:handle).

          define new shared workfile work_abs_mstr like abs_mstr.

          find first soc_ctrl no-lock.

          find abs_mstr where recid(abs_mstr) = global_recid no-lock no-error.

          abs-confirm = " ".
          if available abs_mstr and (abs_id begins "s" or abs_id begins "c") and
/*K08N*/     (can-find
/*K08N*/        (im_mstr where
/*K08N*/           im_inv_mov eq abs_inv_mov and
/*K08N*/           im_tr_type eq "ISS-WO") or
/*K08N*/      abs_type eq "u")

/*K08N*   abs_type = "s"  *K08N*/

          then do:
          /* GET THE STATUS OF SHIPPER ALREADY CONFIRMED OR NOT */
          abs-confirm = substr(abs_status,2,1) .
             find si_mstr where si_site = abs_shipfrom no-lock.

             display
             abs_shipfrom
             si_desc
             abs_id format "x(1)" @ type
             substr(abs_id,2,50) @ abs_id
             with frame a.
          end.

          display type with frame a.


          repeat:
             prompt-for type abs_shipfrom abs_id with frame a editing:
                global_site = input abs_shipfrom.
                global_loc = "y".

                if frame-field = "abs_shipfrom" then do:

/*K08N*          {mfnp05.i abs_mstr abs_id
 *K08N*          "abs_id begins substr(input type,1,1)"
 *K08N*          abs_shipfrom
 *K08N*          "input abs_shipfrom"}
 *K08N*/

/*K08N*/         {mfnp05.i abs_mstr abs_id
                    "(abs_id begins substring(input type,1,1)) and
                     (can-find
                         (im_mstr where
                            im_inv_mov eq abs_inv_mov and
                            im_tr_type eq ""ISS-WO"") or
                      abs_type eq ""u"")"
                    abs_shipfrom
                    "input abs_shipfrom"}

                 if recno <> ? then do:
                    find si_mstr where si_site = abs_shipfrom no-lock no-error.

                    assign
                    disp_abs_id = substr(abs_id,2,50).

                    display
                    abs_shipfrom
                    si_desc          when (available si_mstr)
                    ""               when (not available si_mstr) @ si_desc
                    disp_abs_id      @ abs_id
                    with frame a.
                 end.
                end.
                else
                if frame-field = "abs_id" then do:

/*K08N*          {mfnp05.i abs_mstr abs_id
 *K08N*          "abs_shipfrom = input abs_shipfrom
 *K08N*          and abs_id begins substring(input type,1,1)"
 *K08N*          abs_id
 *K08N*          " ""s"" + input abs_id"}
 *K08N*/

/*K08N*/         {mfnp05.i abs_mstr abs_id
                    "(abs_shipfrom eq input abs_shipfrom) and
                     (abs_id begins substring(input type,1,1)) and
                     (can-find
                         (im_mstr where
                            im_inv_mov eq abs_inv_mov and
                            im_tr_type eq ""ISS-WO"") or
                      abs_type eq ""u"")"
                    abs_id
                    " ""s"" + input abs_id"}

                 if recno <> ? then do:
                    find si_mstr where si_site = abs_shipfrom no-lock no-error.

                    assign
                    disp_abs_id = substr(abs_id,2,50).

                    display
                    abs_shipfrom
                    si_desc          when (available si_mstr)
                    ""               when (not available si_mstr) @ si_desc
                    disp_abs_id      @ abs_id
                    with frame a.
                 end.
                end.
                else do:
                 ststatus = stline[3].
                 status input ststatus.
                 readkey.
                 apply lastkey.
                end.
             end.


             clear frame c all no-pause.

             assign type.
             assign ctype = if type then "s" else "c".

             find abs_mstr where abs_shipfrom = input frame a abs_shipfrom
             and abs_id = ctype + input frame a abs_id no-lock no-error.

             if not available abs_mstr then do:
                {mfmsg.i 8123 3}
                bell.
                undo, retry.
             end.

/*K08N*      if abs_type <> "u" then do:  *K08N*/

/*K08N*/     if not can-find
/*K08N*/        (im_mstr where
/*K08N*/           im_inv_mov eq abs_inv_mov and
/*K08N*/           im_tr_type eq "ISS-WO") and
/*K08N*/        (abs_type ne "u") then do:
                {mfmsg.i 5106 3}
                undo, retry.
             end.

             abs_recid = recid(abs_mstr).
/*G19J*/     shipper_id = substring(abs_id,2).
             ship_date = abs_shp_date.

             find si_mstr where si_site = abs_shipfrom no-lock.

             if substr(abs_status,1,1) = "y" then do:
                {mfmsg.i 8124 2}
                bell.
             end.


             {mfselprt.i "printer" 80}
/*GUI*/ RECT-FRAME:HEIGHT-PIXELS in frame a = FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.


/*N002*/     /* MOVED BODY OF REPORT PRODUCING CODE TO RERP11A.P */
/*N002*/        {gprun.i ""rerp11a.p"" "(abs_recid)"}


             {mfreset.i}
/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/


             do trans:
                /* MARK PRINTED */
                find abs_mstr where recid(abs_mstr) = abs_recid exclusive-lock.
                substr(abs_status,1,1) = "y".

                assign
                global_recid = recid(abs_mstr).

                release abs_mstr.
             end.
          end.

/*N002*/ if is_wiplottrace_enabled() then
/*N002*/    delete procedure h_wiplottrace_procs no-error.
/*N002*/ if is_wiplottrace_enabled() then
/*N002*/    delete procedure h_wiplottrace_funcs no-error.
